home *** CD-ROM | disk | FTP | other *** search
/ MacWarehouse Macintosh Games / MacWarehouse Macintosh Games.iso / AMBER demo / ROXY / ROXY.dxr / 00022_scan icon --.ls < prev    next >
Encoding:
Text File  |  1996-10-18  |  3.8 KB  |  117 lines

  1. on mouseDown
  2.   global oPuppeteer, oStoryteller, gScanFinish, gCPU
  3.   set pkScanIcon to 41
  4.   set pkBarIcon to 42
  5.   set pkAmberIcon to 43
  6.   set camSprite to 44
  7.   set peekText to 40
  8.   set peekVideo to getProp(the lsForegroundData of oPuppeteer, #PkVideoNormal)
  9.   resetPeeKdisplay()
  10.   set currentStatus to getState(oStoryteller, #PKscanStatus)
  11.   if (currentStatus = #ReadyForPlayback) and (getState(oStoryteller, #scanUnitIsActive) = 0) then
  12.     set currentStatus to #Online
  13.     setProp(the lsStateData of oStoryteller, #PKscanStatus, [#Online])
  14.   end if
  15.   if getPos([#Wait1min, #Wait2min, #Wait3min, #Wait4min, #Wait5min], currentStatus) then
  16.     if not gScanFinish then
  17.       put ">‚Ä¢> There is no set 'gScanFinish' time.. this can only lead to trouble..."
  18.       exit
  19.     else
  20.       set minutesRemaining to ((gScanFinish - the ticks) / 3600) + 1
  21.       if minutesRemaining > 0 then
  22.         set currentStatus to getAt([#Wait1min, #Wait2min, #Wait3min, #Wait4min, #Wait5min], minutesRemaining)
  23.       else
  24.         set currentStatus to #ReadyForPlayback
  25.       end if
  26.     end if
  27.   end if
  28.   if (currentStatus <> #Offline) and (currentStatus <> #CantAttach) then
  29.     set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiFrames of oPuppeteer, #scanIcon), 4)
  30.     setState(oStoryteller, #PKscanStatus, currentStatus)
  31.   end if
  32.   set textList to getProp(the lsMultiFrames of oPuppeteer, #peekText)
  33.   set stateMsg to value("#scan" & currentStatus)
  34.   set the castNum of sprite 40 to getProp(textList, stateMsg)
  35.   soundEffect(#peekButton)
  36.   if gCPU = #PC then
  37.     suspendSounds()
  38.   end if
  39.   updateStage()
  40.   set whichKnob to getState(oStoryteller, #DoorWithScanUnit)
  41.   if whichKnob = #kitchenInside then
  42.     set PKscan to #none
  43.   end if
  44.   if whichKnob = #kitchenOutside then
  45.     set PKscan to getProp(peekVideo, #PkPatioScan)
  46.   end if
  47.   if whichKnob = #bathroomInside then
  48.     set PKscan to getProp(peekVideo, #PkBathroomScan)
  49.   end if
  50.   if whichKnob = #bathroomOutside then
  51.     set PKscan to #none
  52.   end if
  53.   if whichKnob = #margaretRmInside then
  54.     set PKscan to #none
  55.   end if
  56.   if whichKnob = #margaretRmOutside then
  57.     set PKscan to getProp(peekVideo, #Pk40sScan)
  58.   end if
  59.   if whichKnob = #garageInside then
  60.     set PKscan to #none
  61.   end if
  62.   if whichKnob = #garageOutside then
  63.     set PKscan to #none
  64.   end if
  65.   if whichKnob = #boathouseInside then
  66.     set PKscan to #none
  67.   end if
  68.   if whichKnob = #boatHouseOutside then
  69.     set PKscan to getProp(peekVideo, #PkBoathouseScan)
  70.   end if
  71.   if whichKnob = #none then
  72.     set PKscan to #none
  73.   end if
  74.   set minutesRemaining to ((gScanFinish - the ticks) / 3600) + 1
  75.   cursorOn()
  76.   repeat while the mouseDown
  77.     nothing()
  78.   end repeat
  79.   set bailOut to 0
  80.   repeat while getPos([#Wait1min, #Wait2min, #Wait3min, #Wait4min, #Wait5min], currentStatus)
  81.     if the mouseDown then
  82.       set bailOut to 1
  83.       set textList to getProp(the lsMultiFrames of oPuppeteer, #peekText)
  84.       set the castNum of sprite peekText to getProp(textList, #none)
  85.       resetPeeKdisplay()
  86.       exit repeat
  87.     end if
  88.     if the ticks > (gScanFinish - (minutesRemaining * 3600) + 3600) then
  89.       set minutesRemaining to minutesRemaining - 1
  90.       if minutesRemaining > 0 then
  91.         setState(oStoryteller, #PKscanStatus, getAt([#Wait1min, #Wait2min, #Wait3min, #Wait4min, #Wait5min], minutesRemaining))
  92.         updateStage()
  93.         next repeat
  94.       end if
  95.       setState(oStoryteller, #PKscanStatus, #ReadyForPlayback)
  96.       updateStage()
  97.       set gScanFinish to 0
  98.       exit repeat
  99.     end if
  100.   end repeat
  101.   if getState(oStoryteller, #PKscanStatus) = #ReadyForPlayback then
  102.     if PKscan = #none then
  103.       exit
  104.     end if
  105.     if voidp(PKscan) then
  106.       exit
  107.     end if
  108.     set the castNum of sprite camSprite to PKscan
  109.     set the movieTime of sprite camSprite to 0
  110.     set the movieRate of sprite camSprite to 0
  111.   end if
  112.   if bailOut then
  113.     idle()
  114.     pass()
  115.   end if
  116. end
  117.